package org.wu.framework.authorization.platform.application.assembler;


import org.wu.framework.authorization.platform.application.command.SysInterfaceCommand;
import org.wu.framework.authorization.platform.application.dto.SysInterfaceDTO;

import org.wu.framework.authorization.platform.domain.model.sys.interface_.SysInterface;
import org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler;

/**
 * describe 接口
 *
 * @author Jia wei Wu
 * @date 2023/05/17 11:19 晚上
 * @see DefaultDDDLazyAssembler
 **/

public class SysInterfaceDTOAssembler {


    /**
     * describe 应用层入参转换成 持久层入参
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/
    public static SysInterface toInterface(SysInterfaceCommand interface_Command) {
        if (null != interface_Command) {
            SysInterface sysInterface_ = new SysInterface();
            sysInterface_.setApplicationName(interface_Command.getApplicationName());
            sysInterface_.setCreateTime(interface_Command.getCreateTime());
            sysInterface_.setDescription(interface_Command.getDescription());
            sysInterface_.setParentPath(interface_Command.getParentPath());
            sysInterface_.setPath(interface_Command.getPath());
            sysInterface_.setRequestMethods(interface_Command.getRequestMethods());
            sysInterface_.setTag(interface_Command.getTag());
            sysInterface_.setUpdateTime(interface_Command.getUpdateTime());
            return sysInterface_;
        }
        return null;
    }

    /**
     * describe 持久层领域对象转换成DTO对象
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/
    public static SysInterfaceDTO fromInterface(SysInterface sysInterface_) {
        if (null != sysInterface_) {
            SysInterfaceDTO interface_DTO = new SysInterfaceDTO();
            interface_DTO.setApplicationName(sysInterface_.getApplicationName());
            interface_DTO.setCreateTime(sysInterface_.getCreateTime());
            interface_DTO.setDescription(sysInterface_.getDescription());
            interface_DTO.setParentPath(sysInterface_.getParentPath());
            interface_DTO.setPath(sysInterface_.getPath());
            interface_DTO.setRequestMethods(sysInterface_.getRequestMethods());
            interface_DTO.setTag(sysInterface_.getTag());
            interface_DTO.setUpdateTime(sysInterface_.getUpdateTime());
            return interface_DTO;
        }
        return null;
    }

}